package com.jingdianjichi.subject.infra.basic.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @Description: //todo
 * @Author: 张广焱
 * @Date: 2024-02-25 9:38
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "subject_index") //把 文件放到哪里 subject_index索引
public class SubjectInfoEsSpringboot {
    @Field(type = FieldType.Long, analyzer = "ik_smart") //这个字段是什么类型
    @Id
    private Long id;
    //题目
    @Field(type = FieldType.Text, analyzer = "ik_smart")//string 类型,分词器
    private String subjectName;
    //答案
    @Field(type = FieldType.Text, analyzer = "ik_smart")//string 类型,分词器
    private String subjectAnswer;
    //创建人
    @Field(type = FieldType.Keyword) //keyword 作为整体 不可分割
    private String createUser;
    //创建时间
    @Field(type = FieldType.Date,index = false) //时间类型 ，不做索引
    private Date createTime;


}
